package com.zcx.mall.goods.controller;

import com.zcx.mall.common.web.api.ApiResult;
import com.zcx.mall.goods.domain.GoodsSimpleInfoVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: zhangcx
 * @create: 2021-01-08 11:37
 **/
@RestController
@Log4j2
public class GoodsInfoController {


    /**
     * 不需要token访问测试
     * @return
     */
    @GetMapping("/goodsIndex")
    public @ResponseBody ApiResult getIndex() {
        //缓存中获取列表
        List<GoodsSimpleInfoVo> list = new ArrayList<>();

        list.add(GoodsSimpleInfoVo.getTest());
        list.add(GoodsSimpleInfoVo.getTest());

        return new ApiResult(list);
    }


}
